package cn.xuewei.controller;

import cn.xuewei.mapper.VideoInfoMapper;
import cn.xuewei.response.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/v1/VideoInfo/")
public class VideoInfoController {
    @Autowired(required = false)
    private VideoInfoMapper mapper;

    @RequestMapping("")
    public ResultVO select(){
        return ResultVO.ok(mapper.select());
    }
    @RequestMapping("/{bvid}")
    public ResultVO select(@PathVariable String bvid){
        return ResultVO.ok(mapper.selectTitle(bvid));
    }

}
